package com.sg.dto.base.calc.common;

import com.sg.common.dto.BaseDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * @desc SectionStandardDataDto
 * @使用场景
 */
@Data
public class SectionStandardDataDto extends BaseDto implements Serializable {

    /**
     * 归属内容表主键ID
     */
    @NotNull(message = "归属内容表主键ID不能为空")
    @ApiModelProperty("归属内容表主键ID")
    private String entityId;

    /**
     * 周期开始时间
     */
    @NotNull(message = "周期开始时间不能为空")
    @ApiModelProperty("周期开始时间")
    private Date cycleStartTime;

    /**
     * 周期结束时间
     */
    @NotNull(message = "周期结束时间不能为空")
    @ApiModelProperty("周期结束时间")
    private Date cycleEndTime;
    /**
     * 实际值
     */
    @ApiModelProperty("实际值")
    private Double actualValue;

    /**
     * 实际值单位 INDIVIDUAL:个 DOOR:门 TERM:项 PIECE:篇 YUAN:元 FEN:分 WAN_YUAN:万元 PERCENT:百分率
     */
    @ApiModelProperty("实际值单位")
    private String actualValueUnit;

    /**
     * 进度值
     */
    @ApiModelProperty("进度值")
    private Double progressValue;

    /**
     * 进度值单位 INDIVIDUAL:个 DOOR:门 TERM:项 PIECE:篇 YUAN:元 FEN:分 WAN_YUAN:万元 PERCENT:百分率
     */
    @ApiModelProperty("进度值单位")
    private String progressValueUnit;

    /**
     * 进度较上次增降幅
     */
    @ApiModelProperty("进度较上次增降幅")
    private Double progressFromLastRatio;

    /**
     * 进度较上次增降幅单位 INDIVIDUAL:个 DOOR:门 TERM:项 PIECE:篇 YUAN:元 FEN:分 WAN_YUAN:万元 PERCENT:百分率
     */
    @ApiModelProperty("进度较上次增降幅单位")
    private String progressFromLastRatioUnit;

    /**
     * 达成度
     */
    @ApiModelProperty("达成度")
    private Double reach;

    /**
     * 达成度单位 INDIVIDUAL:个 DOOR:门 TERM:项 PIECE:篇 YUAN:元 FEN:分 WAN_YUAN:万元 PERCENT:百分率
     */
    @ApiModelProperty("达成度单位")
    private String reachUnit;

    /**
     * 达成度较上次增降福
     */
    @ApiModelProperty("达成度较上次增降福")
    private Double actualFromLastTimeRatio;

    /**
     * 达成度较上次增降福单位 INDIVIDUAL:个 DOOR:门 TERM:项 PIECE:篇 YUAN:元 FEN:分 WAN_YUAN:万元 PERCENT:百分率
     */
    @ApiModelProperty("达成度较上次增降福单位")
    private String actualFromLastTimeRatioUnit;

    /**
     * 实时得分
     */
    @ApiModelProperty("实时得分")
    private Double realTimeScore;

    /**
     * 实时得分单位
     */
    @ApiModelProperty("实时得分单位")
    private String realTimeScoreUnit;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        SectionStandardDataDto that = (SectionStandardDataDto) o;
        return entityId == that.entityId && cycleStartTime == that.cycleStartTime && cycleEndTime == that.cycleEndTime && actualValue == that.actualValue && actualValueUnit == that.actualValueUnit && progressValue == that.progressValue && progressValueUnit == that.progressValueUnit && progressFromLastRatio == that.progressFromLastRatio && progressFromLastRatioUnit == that.progressFromLastRatioUnit && reach == that.reach && reachUnit == that.reachUnit && actualFromLastTimeRatio == that.actualFromLastTimeRatio && actualFromLastTimeRatioUnit == that.actualFromLastTimeRatioUnit && realTimeScore == that.realTimeScore && realTimeScoreUnit == that.realTimeScoreUnit;
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), entityId, cycleStartTime, cycleEndTime, actualValue, actualValueUnit, progressValue, progressValueUnit, progressFromLastRatio, progressFromLastRatioUnit, reach, reachUnit, actualFromLastTimeRatio, actualFromLastTimeRatioUnit, realTimeScore, realTimeScoreUnit);
    }

}
